package utils

import (
	"database/sql"
	"fmt"

	_ "github.com/go-sql-driver/mysql"
)

var db *sql.DB

func init() {
	var err error
	db, err = sql.Open("mysql", "root:123456@tcp(10.130.30.146:3306)/message_center?charset=utf8")
	if err != nil {
		fmt.Println(err)
	}
	db.SetMaxOpenConns(100)
	db.SetMaxIdleConns(5)
	db.Ping()
}
func GetDb() *sql.DB {
	return db
}
